<%--
  Created by IntelliJ IDEA.
  User: shen
  Date: 2020/5/11
  Time: 16:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html xmlns:th="http://www.thymEleaf.org">
<head>
    <base href="<%=basePath%>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>查看历史测试</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <%@include file="../common_resource.jsp" %>
    <style type="text/css">
        .main_body{
            /*position: relative;
            top:190px;*/
            font-size: 15px;
        }
        .table{
            font-size: 14px;
        }
    </style>
</head>
<body class="main_body">
<div class="container container-1180" >
    <div class="col" style="margin-top: 10px;">
        <div class="panel panel-info">
            <div class="panel-heading">
                <span ><i class="fa fa-user"></i></span> <label><font style="font-weight: bold;margin-left: 10px;font-size: 15px">历史测试信息</font></label>
                <label style="float: right;">

                </label>
            </div>
            <form id="searchForm" name="searchForm" role="form"   action="testPaper/test" method="post">
                <!-- 试题类型 -->
                <!-- 查询 -->
                <input type="hidden" name="coll_exp" value="0" />
                <table class="table table-hover table-bordered table-striped table-condensed" style="text-align: center ;width: 100%;">
                    <thead >
                    <tr >
                        <td >试卷编号</td>
                        <td >试卷总分</td>
                        <td>试卷难度系数</td>
                        <td>试卷得分</td>
                        <td>创建时间</td>
                        <td>操作</td>
                    </tr>
                    </thead>
                    <tbody>
                    <!-- 列表 -->
                    <div class="listDiv" id="allExam" style="">
                        <c:forEach var="rUnit" items="${sessionScope.AllHistoryExamList}" varStatus="status">
                             <tr>
                                <td>
                                    <a id="resultUnit" onclick="selectHistoryExam('${rUnit.examNo}','${sessionScope.loginUser.sstsUserID}')" >${rUnit.examNo}</a>
                                </td>
                                <td>${rUnit.totalValues}</td>
                                <td>${rUnit.eDifficultyLevel}</td>
                                <td>${rUnit.totalScores}</td>
                                <td><fmt:formatDate value="${rUnit.examDate}" type="both"></fmt:formatDate></td>
                                 <td class="col-md-3">
                                     <a onclick="selectHistoryExam('${rUnit.examNo}','${sessionScope.loginUser.sstsUserID}')" class="btn btn-success">查看测试详情</a>
                                 </td>
                             </tr>
                            </c:forEach>
                    </div>
                    </tbody>
                </table>

            </form>
        </div>
    </div>
</div>


<script src="bootstrap/plugins/transition.js"></script>
<script src="bootstrap/plugins/modal.js"></script>
<script src="bootstrap/plugins/tooltip.js"></script>
<script src="bootstrap/plugins/popover.js"></script>
<script src="bootstrap/plugins/collapse.js"></script>
<script src="bootstrap/js/jquery.editable-select.min.js"></script>
<script src="js/jquery-2.0.0.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>

<script>
    function selectHistoryExam(examNo,userId){
        console.log(examNo)
        $.get( 'testPaper/selectHistoryExam',{examNo:  examNo,userId: userId}, function(res){
            //alert(res.selectExam)
                if(res.selectExam){
                    //跳转历史测试页面
                    //alert("成功")
                    location.href="views/exam/historyTest.jsp"
                }else {
                    alert("error");
                }
        })
    }
</script>
</body>
</html>


